package ExceptionTest;

public class Test02 {
    public static void main(String[] args) {
        //空指针异常--NullPointerException
        String str = null;
//        System.out.println(str.charAt(0));
        //纠错
        if (str != null){
            System.out.println(str.charAt(0));
        }
    }
}
